package crudfx.container;
import crudfx.interop.*;
import java.awt.*;
import crudfx.data.*;
import javax.swing.*;
/**
 * @profile desktop
 * @author Sergey Surikov
 */
public class ToolPanel extends UIComponent {
    var jToolBar:JToolBar;
    public var content:ToolItem[] on replace {addComponents(); };
    function addComponents(){
        jToolBar.removeAll();
        /*jToolBar.add(new JButton("serfh"));
        jToolBar.add(new JButton("erg"));
        jToolBar.add(new JButton("ssaererfh"));
        jToolBar.add(new JButton("sersrtfh"));*/
        for(c:ToolItem in content){
            //jToolBar.add(c.getJComponent());
            c.add(jToolBar);
            //jToolBar.addSeparator();
            }
        }
    init{
        jToolBar=JToolBar{
            override public function getLocationOnScreen():Point{
                var point:Point=new Point(40,0);
                //println(super.getLocationOnScreen());
                //println(super.getLocation());

                return point;
                }
            };
        addComponents();
        }
    override public function getJComponent():JComponent{
        return jToolBar;
        }
    override public function highlight(s:String):Boolean{
        return false;
        }
    override public function gather():DataTree{
        var me:DataTree=DataTree{ name:"ToolPanel" };
        return me;
        }
    }
